#define  _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void test1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrintf(plist);
	LTPushFront(plist, 5);
	LTPushFront(plist, 6);
	LTPushFront(plist, 7);
	LTPushFront(plist, 8);
	LTPrintf(plist); 
	LTPopFront(plist);
	LTPrintf(plist);
	LTPopBack(plist);
	LTPrintf(plist);
	LTDestroy(plist);
}
void test2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 5);
	LTPrintf(plist);
	LTPushFront(plist, 6);
	LTPushFront(plist, 7);
	LTPushFront(plist, 8);
	LTPushFront(plist, 10);
	LTPrintf(plist);
	LTNode* pos1 = LTFind(plist, 8);
	if (pos1)
	{
		LTInsert(pos1, 9);
	}
	LTNode* pos2 = LTFind(plist, 5);
	if (pos2)
	{
		LTInsert(pos2, 4);
	}
	LTPrintf(plist);
	LTNode* pos3 = LTFind(plist, 1);
	if (pos3)
	{
		LTErase(pos3);
	}
	LTPrintf(plist);
	LTDestroy(plist);

}
int main()
{
	test1();
	test2();
	return 0;
}
































